The present invention relates in general to the field of capacitive sensing, and in particular, to capacitive sensing methods and systems having increased resolution and automatic calibration, suitable for use in a wide variety of products and objects, including, but not limited to, toys and robotic apparatus.
In the rapidly expanding universe of interactive toys, robotic devices and other objects, it has long been desirable to provide sensing that enables xe2x80x9cintelligentxe2x80x9d responses from the object and interactivity with the user. For example, toy manufacturers have long sought to provide baby dolls with xe2x80x9clife-likexe2x80x9d behavior. One simple approach has involved the use of pushbuttons or contact switches to sense presence or activity, such as squeezing, shaking, patting and the like. Interactive toys such as dolls, simulated animals or other creatures typically contain pushbuttons or squeeze switches to provide tactile sensing.
However, pushbuttons or similar switches suffer from a variety of limitations. They are not natural looking or feeling, and in a doll or toy setting, inhibit natural interaction (imagine, for example, a baby doll with pushbuttons). In addition, many sensing systems typical of the prior art cannot reliably detect touch through several layers of fabric or stuffing or plastics, and leave metallic or other potentially dangerous components exposed on the outside of the toy or other object. Still further, existing switching systems add complexity, cost and reliability problems.
In addition to pushbuttons, various other methods have been proposed for providing presence, contact or activity sensing in toys and other objects. Some examples are described in the following U.S. patents, incorporated herein by reference:
U.S. Pat. No. 4,272,916 Giordano et al.
U.S. Pat. No. 4,879,461 Philipp
U.S. Pat. No. 5,413,518 Lin
U.S. Pat. No. 5,682,032 Philipp
U.S. Pat. No. 5,730,165 Philipp
U.S. Pat. No. 6,039,628 Kusmiss et al.
Among these are a number of capacitive sensing techniques. For example, in U.S. Pat. No. 4,272,916 to Giordano et al. and U.S. Pat. No. 5,413,518 to Lin, capacitive sensing is applied to toys to enable proximity sensing. Examples of capacitive sensing elements and devices are available from Quantum Research Group, Ltd. of Pittsburgh, Pa. (xe2x80x9cQProxxe2x80x9d). In a xe2x80x9cwhite paperxe2x80x9d available at www.qprox.com/background/white_paper.shtml, and in the above-referenced U.S. Pat. Nos. 4,879,461; 5,682,032 and 5,730,165, all incorporated herein by reference, QProx describes various techniques, including a charge-transfer technology incorporated into specialized, single-purpose integrated circuits for capacitive sensing.
From a practical standpoint, however, while capacitive sensing is well-known, the components required by prior art methods and systems have generally been too expensive and complex for deployment in toys and other low-cost objects.
Accordingly, it would be desirable to provide simple, reliable, low-cost capacitive sensing methods and systems suitable for use in a wide range of toys, robotic devices or other objects.
It is also desirable to provide systems and methods that (for toys and dolls) can reliably detect touch through several layers of fabric or stuffing or plastic; do not require metallic or other potentially dangerous components exposed on the outside; present a natural xe2x80x9clookxe2x80x9d and xe2x80x9cfeelxe2x80x9d, and enable a natural, non-mechanical interaction.
Still further, in many applications it is also desirable to provide methods and systems capable of detecting not only touch, but patterns of touch, such as tickle, pet, bounce, burp, slap, or other. For example, it would be desirable to enable a toy to be able to detect and respond not only to whether the child is playing with the toy, but how the child is playing with the toy.
More particularly, it is desirable to provide advanced signal processing that supports the creation of virtual sensors (e.g., a proximity sensor; a tickle sensor; a pet sensor) that compile and synthesize a wide range of information from one or more simple physical sensors. This functionality would further support recognition and xe2x80x9clearningxe2x80x9d of signal patterns or signatures. In a toy example, this would provide a powerful interactivity capability, since the toy would know how it is being played with (pet, slap, etc.) and even learn the interactivity patterns of its owner.
It is also desirable to provide such functionality inexpensively, using existing components where possible, with high resolution and automatic and continuous calibration, and with noise rejection to reduce the incidence of false positives (e.g., false detection of touch or touch patterns).
The present invention provides and enables the foregoing features, benefits, and advantages, among others. In one aspect, the invention comprises low-cost methods and systems for capacitive proximity and contact sensing, using a simple sensor (which may be a conductive fiber or pattern of conductive ink) integrated with a microcontroller, with advanced digital signal processing that provides resolution enhancement, automatic and continuous calibration, noise reduction, and pattern recognition.
Basic Hardware Configuration
In one aspect, the capacitive sensing system includes a power source to supply electrical charge; a microcontroller, in communication with the power source and having at least one digital logic input/output (I/O) pin; a conductive sense element (which may be a plate, surface, wire, thread or conductive ink pattern) coupled to the port, and a resistance element coupled to the sense element. A variable capacitor configuration is formed by the sense plate and an object (such as a human hand) in proximity to the sense plate, and the capacitance thereof is representative of the proximity of the object to the sense element. After the conductive sense element is charged by a voltage placed on the I/O pin, the time (or other parameter) necessary to discharge the sense element through the resistance element can be measured to determine the capacitance, and thus the proximity of an object to the sense element. By digitally processing the signals on the I/O pin, the system can provide resolution enhancement, automatic and continuous calibration, noise reduction and pattern recognition. In particular, the system can be made sensitive to very small changes of capacitance, despite large sensor offsets; relatively insensitive to random sensor noise caused, for example, by nearby electrical circuitry; self calibrating at the factory to compensate for variations in chip specifications and other manufacturing tolerances; and auto-calibrating to compensate for drift over time.
Measurement
In one aspect of the invention, capacitance is measured by measuring the time required to discharge the capacitance through a resistance using the above-described configuration of microcontroller I/O pin, sense element and resistor. In accordance with this aspect, a method includes: setting the I/O pin to OUTPUT mode with its state HIGH, thus charging the capacitor to the supply voltage of the microcontroller; then setting the I/O pin to INPUT mode (referred to hereinafter as changing the direction of the I/O pin or turning around the I/O pin); and then measuring the time required for the voltage measured at the pin (V.pin) to fall below the threshold voltage of the microcontroller. The measured discharge time is approximately proportional to the resistance of the resistor (R.discharge) times total capacitance (C). Since the microcontroller uses a stable clock, digital signal processing techniques are employed to make high-resolution measurements of time. In this way, small changes in capacitance (C) can be reliably measured.
In another aspect of the invention, capacitance is measured by counting pulses required to discharge the capacitance through a resistance. By counting pulses of fixed magnitude, a measure of capacitance is obtained. The digital signal processing techniques described herein are equally applicable to capacitance measurements derived thereby.
Auto-Calibration
Methods of automatic calibration in the capacitive sensing system include the steps of detecting, at power-up, a first stable value; designating that first detected stable value as an initial calibration value; incrementing, at a fixed interval, the initial calibration value; continuously examining detected values; and when a new stable value lower than the current calibration value is detected, replacing the current calibration value with the new stable value.
Resolution Enhancement
In yet another aspect, methods to increase resolution of measurement in the capacitive sensing system include the steps of taking multiple timing-based measurements of a given value using different timing offsets, and then averaging across the multiple timing-based measurements. In a particular practice of the invention, a measurement timing loop in the microcontroller is defined to have a characteristic resolution of 3T (T being one microcontroller clock cycle), through the use of a single ADC (add with carry) instruction per loop step. Then, the timing loop is run iteratively with fixed delays of 2T, 3T, or 4T (effectively a time shift of xe2x88x921T, 0 or +1T respectively) added between the instruction that changes the direction of the I/O pin and the beginning of the counting loop. Next, an average is taken of the three measurements thereby obtained, resolving the total loop time to the nearest T.
Pattern Recognition
Digital signal processing enables the creation of virtual sensors capable of using the sense circuitry to detect patterns of proximity or contact. In one aspect, a touch sensor detects contact with or proximity to the sense element, by detecting whether a raw value obtained from the sense element is above a baseline calibrated value by a threshold amount for a certain number of successive measurements. If it is, then TOUCH is detected. If the raw value falls below the sum of the calibration value and the threshold amount, no touch is detected.
In another aspect, a hold sensor detects a sustained touch over an extended period of time, by detecting whether the raw value is above the baseline calibrated value by a threshold amount, and if it is, then increasing an activation level of the sensor; or if the raw value is below the baseline calibrated value, decreasing the activation level of the sensor. If the activation level exceeds a trigger value, HOLD is detected; otherwise, no HOLD is detected.
In still another aspect, a slap sensor detects a quick touch or slap, by maintaining a touch/no-touch history over a number of sample times; and then comparing this temporal pattern to a pattern stored in a lookup table that indicates whether the detected pattern is valid as a slap, and in response thereto, signaling a SLAP.
A rhythm sensor detects whether a particular pattern of touch falls within a set of predetermined constraints describing duration of touch and time between touches. The rhythm sensor operates by detecting rising and falling edges as defined in the activity sensor, above. The sensor has an activation level that is decayed at a fixed rate. At a rising edge, the sensor starts a timer. At the next falling edge, it determines whether the duration of the touch, according to the timer, is within a predefined range. Then, at the next rising edge, the sensor again examines the time to determine whether the period (time between touches) is also within range. If both conditions are met, the activation level of the sensor is incremented by a fixed attack plus the period.
A pet sensor detects a petting contact and distinguishes it from other types of touch (and from noise), using techniques similar to the rhythm sensor, but also including a bandpass filter to preprocess the signal before the detection of rising and falling edges. In this preprocessing, the raw capacitive sensor values are passed first to a low-pass filter. The output of the low-pass filter is then filtered again through a high-pass filter. In applications that can afford the use of a small amount of extra memory for the filtering operations, this results in significantly better performance in distinguishing a true petting motion from other kinds of touch and spurious noise.
A sequence sensor can employ three capacitive sensors that detect a sequence of edges, thereby differentiating between a forward stroke contact from a backward stroke contact (as might be useful in a simulated cat, which would reward stroking in a particular direction).
A proximity sensor produces a value that corresponds to the proximity of a hand or other conductive object to the sense element. The proximity sensor employs a smoothed, noise-reduced capacitive sensor reading to represent proximity. This is accomplished by keeping a running average of past values, and averaging in each new value as it is read. This averaged value is the proximity. Other virtual sensors are described hereinafter.
Objects Using Sensing System
In another aspect, the invention comprises an object having a microcontroller in communication with multiple sense elements like that described above, the microcontroller being capable of executing digital signal processing steps to provide resolution enhancement, automatic and continuous calibration, noise reduction and pattern recognition. The object can be, for example, a toy or robotic apparatus. The pattern recognition aspect supports the creation of virtual sensors including, in particular examples, sensors of touch, tickle, pet, slap, bounce, squeeze and other manipulations. These virtual sensors can be synthesized from a single, simple sense element or by collection of signals from multiple sense elements in communication with the associated microcontroller.
Other Aspects and Advantages
In a further aspect, methods and systems are provided for sensing the presence of a non-conductive element interspersed between the sense element and electrical ground. This can be useful, for example, in sensing the relative position of an articulated portion of a robotic object, such as the position of the head/neck portion of a robot.
The invention provides numerous technical advantages. For example, the sensor utilizes existing I/O and stable clock source of standard, low-cost microcontrollers already present in many xe2x80x9csmartxe2x80x9d objects; and since the system uses only limited microcontroller resources (a sense element requires only a single I/O pin), one microcontroller can support many sensors (eight sensors can be operated from a typical 8-bit digital logic port). The hardware configuration of the invention requires only one external resistor per sensor, further reducing cost; and no variable frequency oscillator, frequency divider, or specific sense-plate geometries or materials are required. Integrated capacitive sensing and signal processing capabilities are thus provided with far fewer components and at lower cost than previously possible. The sensors are automatically and continuously calibrated, and integrated noise rejection reduces the incidence of false positives.
In practical applications, such as toys, the invention can reliably detect touch through several layers of fabric or stuffing or plastic; does not require metallic or other potentially dangerous components exposed on the outside; can be natural looking and feeling, thus enabling a more natural, non-mechanical interaction than that provided by conventional mechanical switches. Still further, the invention can detect not only touch, but also patterns of touch, such as tickle, pet, bounce, squeeze, burp, slap, or other. In a toy, this enables detection not only of whether a child is playing with the toy, but how the child is playing with the toy. The virtual sensor aspects of the system (e.g., a proximity sensor; a tickle sensor; a pet sensor) can compile and synthesize a wide range of information from one or more simple physical sensors (such as a pattern of conductive ink); and enable recognition and xe2x80x9clearningxe2x80x9d of signal patterns or signatures. This enables a powerful interactivity capability, since the toy or other object xe2x80x9cknowsxe2x80x9d how it is being manipulated (squeeze, tickle, pet, slap, or other) and can even xe2x80x9clearnxe2x80x9d the interactivity patterns of its user(s).
The following Detailed Description provides additional information and further examples.